<%= form_remote_tag(:update => "issue-list", :url => { :action => :update_list })%>
    <p><label for="static_project">Project</label><br/>
    <% @keys = Project.find(:all).map {|k| [k.name, k.key]} %>
    <%= select(:static_project, nil, @keys, {:selected => @session[:active_project]}) %></p>
    <%= submit_tag "Refresh" %>
<%= end_form_tag %>

<h1>Issues: <%= controller.action_name %></h1>
<div id="issue-list">
<table>
  <tr>
    <th>Key</th>
    <th>Type</th>
    <th>Component</th>
    <th>Version</th>
    <th>Title</th>
    <th>A</th>
    <th>C</th>

    <th colspan="3">Operations</th>
  </tr>
  
<% for issue in @issues %>
  <tr class="<%= cycle('list-line-odd', 'list-line-even') %>">
    <td><%= h issue.project_key + "-" + issue.id.to_s %></td>
    <td><%= h issue.issue_type %></td>
    <td><%= h issue.component %></td>
    <td><%= h issue.version %></td>
    <td><%= h issue.title %></td>
    <td><%= h issue.assigned_initials %></td>
    <% if issue.complete then %>
    <td width="10"><img src="/images/accept.png"/></td>
    <% else %>
    <td width="10"><img src="/images/cancel.png"/></td>
    <% end %>
    <td><%= link_to 'Show', :action => 'show', :id => issue %></td>
    <td><%= link_to 'Edit', :action => 'edit', :id => issue %></td>
    <td><%= link_to 'Destroy', { :action => 'destroy', :id => issue }, :confirm => 'Are you sure?', :method => :post %></td>
  </tr>
<% end %>
</table>
</div>
<%= link_to 'Previous page', { :page => @issue_pages.current.previous } if @issue_pages.current.previous %>
<%= link_to 'Next page', { :page => @issue_pages.current.next } if @issue_pages.current.next %> 

<p></p>

<%= link_to 'New issue', :action => 'new' %>

